import {createRouter, createWebHistory} from 'vue-router'
import Home from '@/views/Home.vue'
import Collection from '@/views/collection/Index.vue'
import CollectionDetails from '@/views/collection/Details.vue'
import CollectionCreate from '@/views/collection/Create.vue'
import Sample from '@/views/sample/Index.vue'
import SampleFaceDataDetail from '@/views/sample/SampleFaceDataDetail.vue'
import SampleCreate from '@/views/sample/Create.vue'
import FaceDataCreate from '@/views/facedata/Create.vue'
import SampleDetail from '@/views/sample/Detail.vue'
import FaceCompare from '@/views/FaceCompare.vue'
import FaceSearch from '@/views/FaceSearch.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home,
            redirect: '/collection',
            children: [
                // 集合列表 集合首页
                {
                    path: '/collection',
                    name: 'collection',
                    component: Collection
                },
                // 集合详情
                {
                    path: '/collection/detail/:namespace/:collectionName',
                    name: 'collection-detail',
                    component: CollectionDetails
                },
                //创建集合
                {
                    path: '/collection/create/:namespace',
                    name: 'collection-create',
                    component: CollectionCreate
                },
                // 样本列表 样本首页
                {
                    path: '/sample',
                    name: 'sample',
                    component: Sample
                },
                // 创建样本
                {
                    path: '/sample/create/:namespace/:collectionName',
                    name: 'sample-create',
                    component: SampleCreate
                },
                //样本详情
                {
                  path: '/sample/detail/:namespace/:collectionName/:sampleId',
                    name: 'sample-detail',
                    component: SampleDetail
                },
                //样本人脸数据详情
                {
                    path: '/sample/detail/:namespace/:collectionName/:sampleId/:data',
                    name: 'sample-face-data-detail',
                    component: SampleFaceDataDetail
                },
                //创建人脸数据
                {
                    path:'/face/data/create/:namespace/:collectionName/:sampleId',
                    name:'face-data-create',
                    component: FaceDataCreate
                },
                // 人脸比对
                {
                    path: '/face/compare',
                    name: 'face-compare',
                    component:FaceCompare
                },
                // 人脸搜索
                {
                    path: '/face/search',
                    name: 'face-search',
                    component: FaceSearch
                }



            ]
        }

    ]
})

export default router
